using Agron.Data.Contracts;

using System;
using System.ServiceModel;


namespace Agron.Services.Contracts
{
    /// <summary>
    /// Defines the callback-contract for the <see cref="ISessionBroker"/> service contract.
    /// </summary>
    public interface ISessionEvents
    {
        /// <summary>
        /// Called when a user joins a session.
        /// </summary>
        /// <param name="isSessionOwner"><c>true</c> if the user that joined is also the session owner; otherwise, false.</param>
        /// <param name="sessionId">The session unique identifier.</param>
        /// <param name="userProfile">A <see cref="UserProfile"/> data contract that represents the User that joined the session.</param>
        /// <param name="timeStamp">A <see cref="DateTime"/> value that signals the moment in which the Join occurred, expressed as the Coordinated Universal Time (UTC).</param>
        /// <param name="internetIPAddress">The internet IP address.</param>
        /// <param name="localIPAddress">The local IP address.</param>
        [OperationContract(IsOneWay = true)]
        void UserJoined(bool isSessionOwner, int sessionId, UserProfile userProfile, DateTime timeStamp, string internetIPAddress, string localIPAddress);

        /// <summary>
        /// Called when a user leaves a session.
        /// </summary>
        /// <param name="isSessionOwner"><c>true</c> if the user that joined is also the session owner; otherwise, false.</param>
        /// <param name="sessionId">The session unique identifier.</param>
        /// <param name="userId">The user's unique identifier.</param>
        /// <param name="timeStamp">A <see cref="DateTime"/> value that signals the moment in which the Join occurred, expressed as the Coordinated Universal Time (UTC).</param>
        [OperationContract(IsOneWay = true)]
        void UserLeft(bool isSessionOwner, int sessionId, Guid userId, DateTime timeStamp);
    }
}
